﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace SpotsHub.RouteService.Data
{
    public class UserBase : EntityBase
    {
        public int UserInformationId { get; set; }

        public virtual UserInformation UserInformation { get; set; }

        [NotMapped]
        public string DisplayName {
            get
            {
                return String.Format("{0} {1}", UserInformation.FirstName, UserInformation.LastName);
            }
        }
    }

    [Table("Route_UserInformation")]
    public class UserInformation : EntityBase
    {
        public int? ExternalId { get; set; }

        [MaxLength(50)]
        public string Account { get; set; }
        
        [MaxLength(50)]
        public string FirstName { get; set; }
        
        [MaxLength(50)]
        public string LastName { get; set; }
    }
}
